import platform
import sys
from os.path import abspath, dirname, expanduser, join, realpath

os_name = platform.system()
mac_ver = platform.mac_ver()[0]
IS_WINDOWS = os_name == "Windows"
IS_MAC = os_name == "Darwin"
IS_DOCKER = os_name == "Linux" or os_name == "Java"

IS_NFC = True  # unicode NFC normalization
if IS_MAC and mac_ver:
    # 旧版本 mac 使用 NFD
    ver_list = mac_ver.split(".")
    if float(ver_list[0] + "." + ver_list[1]) < 10.12:
        IS_NFC = False

IS_PYINSTALLER = hasattr(sys, "frozen")
IS_NUITKA = "__compiled__" in globals()  # nuitka 编译


"""
MAIN_PATH 是唯一硬编码的路径, 其定义如下:
- 绝对路径
- 从源代码运行时, 表示 main.py 所在目录
- 运行 pyinstaller/nuitka 打包的程序时, 在 macOS 上表示 `~/.mdcx`, 在 Windows 上表示 exe 所在目录

此路径的作用是, 该目录下有一个文件 (MDCx.config),
此文件中存储一个绝对路径, 指向当前启用的配置文件,
同时, 该配置文件所在的目录即为用户数据目录.

todo 已验证符合预期:
- [x] mac - pyinstaller
- [x] mac - source
- [ ] windows - pyinstaller
- [ ] windows - source
- [ ] docker?
"""
try:  # 从源代码运行时, 为 main.py 所在目录, 根据此文件路径确定, 若移动此文件需修改
    MAIN_PATH = realpath(__file__)  # mdcx/consts.py
    i = 2
    if "__compiled__" in globals():  # nuitka 编译
        i = 1
    for _ in range(i):
        MAIN_PATH = dirname(MAIN_PATH)
except Exception:
    MAIN_PATH = abspath(sys.path[0])

# 运行 pyinstaller/nuitka 打包的程序时, 在 macOS 上为 `~/.mdcx`, 在 Windows 上为 exe 所在目录
if IS_PYINSTALLER:  # 是否Bundle Resource，是否打包成exe运行
    if IS_MAC:
        MAIN_PATH = join(expanduser("~"), ".mdcx")
    else:
        MAIN_PATH = abspath("")  # 打包后，路径是准的

MARK_FILE = join(MAIN_PATH, "MDCx.config")


def show_constants():
    """显示所有运行时常量"""
    constants = {
        "MAIN_PATH": MAIN_PATH,
        "IS_WINDOWS": IS_WINDOWS,
        "IS_MAC": IS_MAC,
        "IS_DOCKER": IS_DOCKER,
        "IS_NFC": IS_NFC,
        "IS_PYINSTALLER": IS_PYINSTALLER,
        "IS_NUITKA": IS_NUITKA,
    }
    print("Run time constants:")
    for key, value in constants.items():
        print(f"\t{key}: {value}")


show_constants()


class ManualConfig:
    # 表示运行时版本, 用于检查更新以及向后兼容配置文件
    LOCAL_VERSION = 120250708

    # 支持的网站, 用于支持自定义域名
    SUPPORTED_WEBSITES = [
        "7mmtv",
        "airav",
        "airav_cc",
        "avsex",
        "avsox",
        "cnmdb",
        "dahlia",
        "dmm",
        "faleno",
        "fantastica",
        "fc2",
        "fc2club",
        "fc2hub",
        "fc2ppvdb",
        "freejavbt",
        "getchu",
        "giga",
        "iqqtv",
        "jav321",
        "javday",
        "javbus",
        "javdb",
        "javlibrary",
        "kin8",
        "love6",
        "lulubar",
        "madouqu",
        "mdtv",
        "hscangku",
        "cableav",
        "mgstage",
        "mywife",
        "prestige",
        "theporndb",
        "xcity",
    ]

    # 可配置来源的字段
    CONFIG_DATA_FIELDS = [
        "actor",
        "director",
        "extrafanart",
        "outline_zh",
        "outline",
        "poster",
        "publisher",
        "release",
        "runtime",
        "score",
        "series",
        "studio",
        "tag",
        "thumb",  # 在 nfo 相关配置中为 cover
        "title_zh",  # 根据语言设置, 分别对应 title 和 originaltitle
        "title",
        "trailer",
        "wanted",
    ]
    # 爬虫返回的字段. 此列表的顺序决定了日志顺序
    CRAWLER_DATA_FIELDS = [
        "title",
        "originaltitle",
        "outline",
        "originalplot",
        "actor",
        "thumb",
        "poster",
        "extrafanart",
        "tag",
        "release",
        "runtime",
        "score",
        "director",
        "series",
        "studio",
        "publisher",
        "trailer",
        "wanted",
        "year",
    ]
    OUMEI_NAME = {
        "wgp": "WhenGirlsPlay",
        "18og": "18OnlyGirls",
        "18yo": "18YearsOld",
        "1kf": "1000Facials",
        "21ea": "21EroticAnal",
        "21fa": "21FootArt",
        "21n": "21Naturals",
        "2cst": "2ChicksSameTime",
        "a1o1": "Asian1on1",
        "aa": "AmateurAllure",
        "ad": "AmericanDaydreams",
        "add": "ManualAddActors",
        "agm": "AllGirlMassage",
        "am": "AssMasterpiece",
        "analb": "AnalBeauty",
        "baebz": "Baeb",
        "bblib": "BigButtsLikeItBig",
        "bcasting": "BangCasting",
        "bconfessions": "BangConfessions",
        "bglamkore": "BangGlamkore",
        "bgonzo": "BangGonzo",
        "brealteens": "BangRealTeens",
        "bcb": "BigCockBully",
        "bch": "BigCockHero",
        "bdpov": "BadDaddyPOV",
        "bex": "BrazzersExxtra",
        "bgb": "BabyGotBoobs",
        "bgbs": "BoundGangbangs",
        "bin": "BigNaturals",
        "bjf": "BlowjobFridays",
        "bp": "ButtPlays",
        "btas": "BigTitsatSchool",
        "btaw": "BigTitsatWork",
        "btc": "BigTitCreampie",
        "btis": "BigTitsinSports",
        "btiu": "BigTitsinUniform",
        "btlbd": "BigTitsLikeBigDicks",
        "btra": "BigTitsRoundAsses",
        "burna": "BurningAngel",
        "bwb": "BigWetButts",
        "cfnm": "ClothedFemaleNudeMale",
        "clip": "LegalPorno",
        "cps": "CherryPimps",
        "cuf": "CumFiesta",
        "cws": "CzechWifeSwap",
        "da": "DoctorAdventures",
        "dbm": "DontBreakMe",
        "dc": "DorcelVision",
        "ddfb": "DDFBusty",
        "ddfvr": "DDFNetworkVR",
        "dm": "DirtyMasseur",
        "dnj": "DaneJones",
        "dpg": "DigitalPlayground",
        "dwc": "DirtyWivesClub",
        "dwp": "DayWithAPornstar",
        "dsw": "DaughterSwap",
        "esp": "EuroSexParties",
        "ete": "EuroTeenErotica",
        "ext": "ExxxtraSmall",
        "fams": "FamilyStrokes",
        "faq": "FirstAnalQuest",
        "fds": "FakeDrivingSchool",
        "fft": "FemaleFakeTaxi",
        "fhd": "FantasyHD",
        "fhl": "FakeHostel",
        "fho": "FakehubOriginals",
        "fka": "FakeAgent",
        "fm": "FuckingMachines",
        "fms": "FantasyMassage",
        "frs": "FitnessRooms",
        "ft": "FastTimes",
        "ftx": "FakeTaxi",
        "gft": "GrandpasFuckTeens",
        "gbcp": "GangbangCreampie",
        "gta": "GirlsTryAnal",
        "gw": "GirlsWay",
        "h1o1": "Housewife1on1",
        "ham": "HotAndMean",
        "hart": "Hegre",
        "hcm": "HotCrazyMess",
        "hegre-art": "Hegre",
        "hoh": "HandsOnHardcore",
        "hotab": "HouseofTaboo",
        "ht": "Hogtied",
        "ihaw": "IHaveAWife",
        "iktg": "IKnowThatGirl",
        "il": "ImmoralLive",
        "kha": "KarupsHA",
        "kow": "KarupsOW",
        "kpc": "KarupsPC",
        "la": "LatinAdultery",
        "lcd": "LittleCaprice-Dreams",
        "littlecaprice": "LittleCaprice-Dreams",
        "lhf": "LoveHerFeet",
        "lsb": "Lesbea",
        "lst": "LatinaSexTapes",
        "lta": "LetsTryAnal",
        "maj": "ManoJob",
        "mbb": "MommyBlowsBest",
        "mbt": "MomsBangTeens",
        "mc": "MassageCreep",
        "mcu": "MonsterCurves",
        "mdhf": "MyDaughtersHotFriend",
        "mdhg": "MyDadsHotGirlfriend",
        "mfa": "ManuelFerrara",
        "mfhg": "MyFriendsHotGirl",
        "mfhm": "MyFriendsHotMom",
        "mfl": "Mofos",
        "mfp": "MyFamilyPies",
        "mfst": "MyFirstSexTeacher",
        "mgbf": "MyGirlfriendsBustyFriend",
        "mgb": "MommyGotBoobs",
        "mic": "MomsInControl",
        "mj": "ManoJob",
        "mlib": "MildsLikeItBig",
        "mlt": "MomsLickTeens",
        "mmgs": "MommysGirl",
        "mnm": "MyNaughtyMassage",
        "mom": "MomXXX",
        "mpov": "MrPOV",
        "mrs": "MassageRooms",
        "mshf": "MySistersHotFriend",
        "mts": "MomsTeachSex",
        "mvft": "MyVeryFirstTime",
        "mwhf": "MyWifesHotFriend",
        "naf": "NeighborAffair",
        "nam": "NaughtyAmerica",
        "na": "NaughtyAthletics",
        "naughtyamericavr": "NaughtyAmerica",
        "nb": "NaughtyBookworms",
        "news": "NewSensations",
        "nf": "NubileFilms",
        "no": "NaughtyOffice",
        "nrg": "NaughtyRichGirls",
        "nubilef": "NubileFilms",
        "num": "NuruMassage",
        "nw": "NaughtyWeddings",
        "obj": "OnlyBlowjob",
        "otb": "OnlyTeenBlowjobs",
        "pav": "PixAndVideo",
        "pba": "PublicAgent",
        "pf": "PornFidelity",
        "phd": "PassionHD",
        "plib": "PornstarsLikeitBig",
        "pop": "PervsOnPatrol",
        "ppu": "PublicPickups",
        "prdi": "PrettyDirty",
        "ps": "PropertySex",
        "pud": "PublicDisgrace",
        "reg": "RealExGirlfriends",
        "rkp": "RKPrime",
        "rws": "RealWifeStories",
        "saf": "ShesAFreak",
        "sart": "SexArt",
        "sbj": "StreetBlowjobs",
        "sislove": "SisLovesMe",
        "smb": "ShareMyBF",
        "ssc": "StepSiblingsCaught",
        "ssn": "ShesNew",
        "sts": "StrandedTeens",
        "swsn": "SwallowSalon",
        "tdp": "TeensDoPorn",
        "tds": "TheDickSuckers",
        "ted": "Throated",
        "tf": "TeenFidelity",
        "tgs": "ThisGirlSucks",
        "these": "TheStripperExperience",
        "tla": "TeensLoveAnal",
        "tlc": "TeensLoveCream",
        "tle": "TheLifeErotic",
        "tlhc": "TeensLoveHugeCocks",
        "tlib": "TeensLikeItBig",
        "tlm": "TeensLoveMoney",
        "togc": "TonightsGirlfriendClassic",
        "tog": "TonightsGirlfriend",
        "tspa": "TrickySpa",
        "tss": "ThatSitcomShow",
        "tuf": "TheUpperFloor",
        "wa": "WhippedAss",
        "wfbg": "WeFuckBlackGirls",
        "wkp": "Wicked",
        "wlt": "WeLiveTogether",
        "woc": "WildOnCam",
        "wov": "WivesOnVacation",
        "wowg": "WowGirls",
        "wy": "WebYoung",
        "zzs": "ZZseries",
        "ztod": "ZeroTolerance",
        "itc": "InTheCrack",
        "abbw": "AbbyWinters",
        "abme": "AbuseMe",
        "ana": "AnalAngels",
        "atke": "ATKExotics",
        "atkg": "ATKGalleria",
        "atkgfs": "ATKGirlfriends",
        "atkh": "ATKHairy",
        "aktp": "ATKPetites",
        "btp": "BadTeensPunished",
        "brealmilfs": "Bang.RealMilfs",
        "byngr": "bang.YNGR",
        "ba": "Beauty-Angels",
        "bgfs": "BlackGFS",
        "bna": "BrandNew",
        "bam": "BruceAndMorgan",
        "bcast": "BrutalCastings",
        "bd": "BrutalDildos",
        "bpu": "BrutalPickups",
        "clubseventeen": "ClubSweethearts",
        "cfnmt": "CFNMTeens",
        "cfnms": "FNMSecret",
        "cza": "CzhecAmateurs",
        "czbb": "CzechBangBus",
        "czb": "CzechBitch",
        "cc": "CzechCasting",
        "czc": "CzechCouples",
        "czestro": "CzechEstrogenolit",
        "czf": "CzechFantasy",
        "czgb": "CzechGangBang",
        "cgfs": "CzechGFS",
        "czharem": "CzechHarem",
        "czm": "CzechMassage",
        "czo": "CzechOrgasm",
        "czps": "CzechPawnShop",
        "css": "CzechStreets",
        "cztaxi": "CzechTaxi",
        "czt": "CzechTwins",
        "dlla": "DadysLilAngel",
        "dts": "DeepThroatSirens",
        "deb": "DeviceBondage",
        "doan": "DiaryOfANanny",
        "dpf": "DPFanatics",
        "ds": "DungeonSex",
        "ffr": "FacialsForever",
        "ff": "FilthyFamily",
        "fbbg": "FirstBGG",
        "fab": "FuckedAndBound",
        "fum": "FuckingMachines",
        "fs": "FuckStudies",
        "tfcp": "FullyClothedPissing",
        "gfr": "GFRevenge",
        "gdp": "GirlsDoPorn",
        "hletee": "HelplessTeens",
        "hotb": "HouseOfTaboo",
        "Infr": "InfernalRestraints",
        "inh": "InnocentHigh",
        "jlmf": "JessieLoadsMonsterFacials",
        "university": "KinkUniversity",
        "lang": "LANewGirl",
        "mmp": "MMPNetwork",
        "mot": "MoneyTalks",
        "mbc": "MyBabysittersClub",
        "mdm": "MyDirtyMaid",
        "nvg": "NetVideoGirls",
        "nubp": "Nubiles-Porn",
        "oo": "Only-Opaques",
        "os": "Only-Secretaries",
        "oss": "OnlySilAndSatin",
        "psus": "PascalsSubSluts",
        "pbf": "PetiteBallerinasFucked",
        "phdp": "PetiteHDPoorn",
        "psp": "PorsntarsPunishment",
        "pc": "PrincessCum",
        "pdmqfo": "QuestForOrgasm",
        "rtb": "RealTimeBondage",
        "rab": "RoundAndBrown",
        "sr": "SadisticRope",
        "sas": "SexAndSubmission",
        "sed": "SexualDisgrace",
        "seb": "SexuallyBroken",
        "sislov": "SisLovesMe",
        "tslw": "SlimeWave",
        "steps": "StepSiblings",
        "stre": "StrictRestraint",
        "t18": "Taboo18",
        "tft": "TeacherFucksTeens",
        "tmf": "TeachMeFisting",
        "tsma": "TeenSexMania",
        "tsm": "TeenSexMovs",
        "ttw": "TeensInTheWoods",
        "tgw": "ThaiGirlsWild",
        "taob": "TheArtOfBlowJob",
        "trwo": "TheRealWorkout",
        "tto": "TheTrainingOfO",
        "tg": "TopGrl",
        "tt": "TryTeens",
        "th": "TwistysHard",
        "vp": "VIPissy",
        "wrh": "WeAreHairy",
        "wpa": "WhippedAss",
        "yt": "YoungThroats",
        "zb": "ZoliBoy",
    }
    OFFICIAL = {
        "https://s1s1s1.com": "sivr|ssis|ssni|snis|soe|oned|one|onsd|ofje|sps|tksoe",  # https://s1s1s1.com/search/list?keyword=soe
        "https://moodyz.com": "mdvr|midv|mide|midd|mibd|mimk|miid|migd|mifd|miae|miad|miaa|mdl|mdj|mdi|mdg|mdf|mde|mdld|mded|mizd|mird|mdjd|rmid|mdid|mdmd|mimu|mdpd|mivd|mdud|mdgd|mdvd|mias|miqd|mint|rmpd|mdrd|tkmide|tkmidd|kmide|tkmigd|mdfd|rmwd|miab",
        "https://www.madonna-av.com": "juvr|jusd|juq|juy|jux|jul|juk|juc|jukd|jusd|oba|jufd|roeb|roe|ure|mdon|jfb|obe|jums",
        "https://www.wanz-factory.com": "wavr|waaa|bmw|wanz",
        "https://ideapocket.com": "ipvr|ipx|ipz|iptd|ipsd|idbd|supd|ipit|and|hpd|tkipz|ipzz|cosd|anpd|dan|alad|kipx",
        "https://kirakira-av.com": "kivr|blk|kibd|kifd|kird|kisd|set",
        "https://www.av-e-body.com": "ebvr|ebod|mkck|eyan",
        "https://bi-av.com": "cjvr|cjod|bbi|bib|cjob|beb|bid|bist|bwb",
        "https://premium-beauty.com": "prvr|pgd|pred|pbd|pjd|prtd|pxd|pid|ptv",
        "https://miman.jp": "mmvr|mmnd|mmxd|aom",
        "https://tameikegoro.jp": "mevr|meyd|mbyd|mdyd|mnyd",
        "https://fitch-av.com": "fcvr|jufe|jufd|jfb|juny|nyb|finh|gcf|nima",
        "https://kawaiikawaii.jp": "kavr|cawd|kwbd|kawd|kwsr|kwsd|kane",
        "https://befreebe.com": "bf",
        "https://muku.tv": "mucd|mudr|mukd|smcd|mukc",
        "https://attackers.net": "atvr|rbk|rbd|same|shkd|atid|adn|atkd|jbd|sspd|atad|azsd",
        "https://mko-labo.net": "mvr|mism|emlb",
        "https://dasdas.jp": "dsvr|dass|dazd|dasd|pla",
        "https://mvg.jp": "mvsd|mvbd",
        "https://av-opera.jp": "opvr|opbd|opud",
        "https://oppai-av.com": "ppvr|pppe|ppbd|pppd|ppsd|ppfd",
        "https://v-av.com": "vvvd|vicd|vizd|vspd",
        "https://to-satsu.com": "clvr|stol|club",
        "https://bibian-av.com": "bbvr|bban",
        "https://honnaka.jp": "hnvr|hmn|hndb|hnd|krnd|hnky|hnjc|hnse",
        "https://rookie-av.jp": "rvr|rbb|rki",
        "https://nanpa-japan.jp": "njvr|nnpj|npjb",
        "https://hajimekikaku.com": "hjbb|hjmo|avgl",
        "https://hhh-av.com": "huntb|hunta|hunt|hunbl|royd|tysf",
        "https://www.prestige-av.com": "abp|mbm|ezd|docp|onez|yrh|abw|abs|chn|mgt|tre|edd|ult|cmi|mbd|dnw|sga|rdd|dcx|evo|rdt|ppt|gets|sim|kil|tus|dtt|gnab|man|mas|tbl|rtp|ctd|fiv|dic|esk|kbi|tem|ama|kfne|trd|har|yrz|srs|mzq|zzr|gzap|tgav|rix|aka|bgn|lxv|afs|goal|giro|cpde|nmp|mct|abc|inu|shl|mbms|pxh|nrs|ftn|prdvr|fst|blo|shs|kum|gsx|ndx|atd|dld|kbh|bcv|raw|soud|job|chs|yok|bsd|fsb|nnn|hyk|sor|hsp|jbs|xnd|mei|day|mmy|kzd|jan|gyan|tdt|tok|dms|fnd|cdc|jcn|pvrbst|sdvr|docvr|fcp|abf",
    }
    SUREN_DIC = {
        "SHN-": "116",  # 116SHN-045
        "GANA": "200",  # 200GANA-2556
        "CUTE-": "229",  # 229SCUTE-953
        "LUXU": "259",  # 200LUXU-2556
        "ARA-": "261",  # 261ARA-094
        "DCV-": "277",  # 277DCV-102
        "EWDX": "299",  # 299EWDX-400
        "MAAN": "300",  # 300MAAN-673
        "MIUM": "300",  # 300MIUM-745
        "NTK-": "300",  # 300NTK-635
        "KIRAY-": "314",  # 314KIRAY-128
        "KJO-": "326",  # 326KJO-002
        "NAMA-": "332",  # 332NAMA-077
        "KNB-": "336",  # 336KNB-172
        "SIMM-": "345",  # 345SIMM-662
        "NTR-": "348",  # 348NTR-001
        "JAC-": "390",  # 390JAC-034
        "KIWVR": "408",  # 408KIWVR-254
        "INST": "413",  # 413INST-202
        "SRYA": "417",  # 417SRYA-015
        "SUKE-": "428",  # 428SUKE-086
        "MFC-": "435",  # 435MFC-142
        "HHH-": "451",  # 451HHH-027
        "TEN-": "459",  # 459TEN-024
        "MLA-": "476",  # 476MLA-043
        "SGK-": "483",  # 483SGK-054
        "GCB-": "485",  # 485GCB-015
        "SEI-": "502",  # 502SEI-001
        "STCV": "529",  # 529STCV-009
        "MY-": "292",  # 292MY-425
        "DANDY": "104",  # 104DANDY-852A
        "ICHK": "368",  # 368ICHK-018
    }
    REPL_LIST = [
        "HEYDOUGA",
        "CARIBBEANCOM",
        "CARIB",
        "1PONDO",
        "1PON",
        "PACOMA",
        "PACO",
        "10MUSUME",
        "-10MU",
        "Tokyo Hot",
        "Tokyo_Hot",
        "TOKYO-HOT",
        "TOKYOHOT",
        "(S1)",
        "[THZU.CC]",
        "「麻豆」",
        "(",
        ")",
        ".PRT",
        "MP4-KTR",
        "rarbg",
        "WEBDL",
        "x2160x",
        "x1080x",
        "x2160p",
        "x1080p",
        "x264 aac",
        "x264_aac",
        "x264-aac",
        "x265 aac",
        "x265_aac",
        "x265-aac",
        "H.264",
        "H.265",
        "DVDRIP",
        "DVD ",
        "2160P",
        "1440P",
        "1080P",
        "960P",
        "720P",
        "540P",
        "480P",
        "360P",
        "4096x2160",
        "1920x1080",
        "1280x720",
        "960x720",
        "640x480",
        "4096×2160",
        "1920×1080",
        "1280×720",
        "960×720",
        "640×480",
        "90fps",
        "60fps",
        "30fps",
        ".cht",
        ".chs",
    ]
    WEB_DIC = {
        "airav.io": "airav_cc",
        "airav.wiki": "airav",
        "9sex": "avsex",
        "avsex": "avsex",
        "avsox": "avsox",
        "dmm.co": "dmm",
        "fc2.com": "fc2",
        "fc2club": "fc2club",
        "fc2hub": "fc2hub",
        "fc2ppvdb": "fc2ppvdb",
        "iqq": "iqqtv",
        "jav321": "jav321",
        "javbus": "javbus",
        "javdb": "javdb",
        "javlibrary": "javlibrary",
        "mdtv": "mdtv",
        "mdpjzip": "mdtv",
        "madouqu": "madouqu",
        "hsck": "hscangku",
        "cableav": "cableav",
        "mgstage": "mgstage",
        "7mmtv": "7mmtv",
        "bb9711": "7mmtv",
        "xcity": "xcity",
        "freejavbt": "freejavbt",
        "getchu": "getchu",
        "mywife": "mywife",
        "giga": "giga",
        "faleno": "faleno",
        "dahlia": "dahlia",
        "hdouban": "hdouban",
        "byym21": "hdouban",
        "huangdb2": "hdouban",
        "lulubar": "lulubar",
        "love6": "love6",
        "cnmdb": "cnmdb",
        "kin8": "kin8",
        "fantastica": "fantastica",
        "theporndb": "theporndb",
        "prestige": "prestige",
    }
    CHAR_LIST = [
        "[高清] (中文字幕)",
        "[高清 (中文字幕)",
        " (中文字幕)",
        " (中文字幕)",
        "[高清中文字幕]",
        "[高清中文字幕",
        "高清中文字幕]",
        "【高清中文字幕】",
        "[高清]",
        "无码流出版",
        "无码流出",
        "无码破解版",
        "无码破解",
        "TOKYO-HOT-",
        "韩文转译版",
        "独家听译版",
        "完整版",
        "特别版",
        "完全版",
        "时间轴修复版",
        "导演剪辑最终版",
        "堂友",
    ]
    ALL_KEY_WORD = ["title", "originaltitle", "outline", "originalplot", "series", "director", "studio", "publisher"]
    ALL_REP_WORD = {
        "&amp;": "＆",  # 将网页中存在二次抓取的&amp;(实际意义为&)的字符全局替换成＆（大写的&，不会被emby误判，显示更美观）
        "&lt;": "<",  # 将网页中存在二次抓取的&lt;(实际意义为<)的字符全局替换成<
        "&gt;": ">",  # 将网页中存在二次抓取的&gt;(实际意义为>)的字符替全局换成>
        "&apos;": "'",  # 将网页中存在二次抓取的&apos;(实际意义为')的字符全局替换成'
        "&quot;": '"',  # 将网页中存在二次抓取的&quot;(实际意义为")的字符替全局换成"
        "&lsquo;": "「",  # 将网页中存在二次抓取的&lsquo;(实际意义为「)的字符全局替换成「
        "&rsquo;": "」",  # 将网页中存在二次抓取的&rsquo;(实际意义为」)的字符全局替换成」
        "&hellip;": "…",  # 将网页中存在二次抓取的&hellip;(实际意义为…)的字符全局替换成…
        "&rarr;": "→",  # 将网页中存在二次抓取的&rarr;(实际意义为→)的字符全局替换成→
        "<br/>": "",  # 将网页中存在的隐藏换行符全局替换成空白
        "&": "＆",  # 将网页本身抓取到的&全局替换成＆（大写的&，不会被emby误判，避免Emby的nfo读取错误，显示更美观）
        "&mdash;": "—",  # 将网页中存在二次抓取的&mdash;(实际意义为—破折号)的字符全局替换成—，破折号”—“不等于数字“一”
        "<": "＜",  # 将网页中存在二次抓取的<字符全局替换成＜（大写的＜，不会被emby误判，避免Emby的nfo读取错误，显示更美观）
        ">": "＞",  # 将网页中存在二次抓取的>字符全局替换成＞（大写的＞，不会被emby误判，避免Emby的nfo读取错误，显示更美观）
        "・": "·",  # 将网页本身的・（人名间隔号）全局替换成·
        "“": "「",  # 将前双引号“全局替换为「，更美观
        "”": "」",  # 将后双引号”全局替换为」，更美观
        "...": "…",  # 将非标准省略号...全局替换成标准省略号…
        "……": "…",  # 将并列的两个省略号……全局替换成单个省略号…  解决......替换成……后出现两个省略号
        "’s": "'s",  # 将非标准英文单引号的’替换全局为标准英文单引号'，避免’s被以下规则替换成」s,例如：love’s替换成love's
        "‘": "「",  # 将前单引号‘全局替换为「，更美观
        "’": "」",  # 将后单引号’全局替换为」，更美观
        ",": "，",  # 将英文逗号,全局替换成中文逗号，
        "?": "？",  # 将英文问号?全局替换成中文问号？
        "! ": "！",  # 去除感叹号后面不必要的空格
        "!": "！",  # 将英文感叹号!全局替换成中文感叹号！
        "Ａ": "A",  # 将全角大写英文替换成半角大写英文
        "Ｂ": "B",  # 将全角大写英文替换成半角大写英文
        "Ｃ": "C",  # 将全角大写英文替换成半角大写英文
        "Ｄ": "D",  # 将全角大写英文替换成半角大写英文
        "Ｅ": "E",  # 将全角大写英文替换成半角大写英文
        "Ｆ": "F",  # 将全角大写英文替换成半角大写英文
        "Ｇ": "G",  # 将全角大写英文替换成半角大写英文
        "Ｈ": "H",  # 将全角大写英文替换成半角大写英文
        "Ｉ": "I",  # 将全角大写英文替换成半角大写英文
        "Ｊ": "J",  # 将全角大写英文替换成半角大写英文
        "Ｋ": "K",  # 将全角大写英文替换成半角大写英文
        "Ｌ": "L",  # 将全角大写英文替换成半角大写英文
        "Ｍ": "M",  # 将全角大写英文替换成半角大写英文
        "Ｎ": "N",  # 将全角大写英文替换成半角大写英文
        "Ｏ": "O",  # 将全角大写英文替换成半角大写英文
        "Ｐ": "P",  # 将全角大写英文替换成半角大写英文
        "Ｑ": "Q",  # 将全角大写英文替换成半角大写英文
        "Ｒ": "R",  # 将全角大写英文替换成半角大写英文
        "Ｓ": "S",  # 将全角大写英文替换成半角大写英文
        "Ｔ": "T",  # 将全角大写英文替换成半角大写英文
        "Ｕ": "U",  # 将全角大写英文替换成半角大写英文
        "Ｖ": "V",  # 将全角大写英文替换成半角大写英文
        "Ｗ": "W",  # 将全角大写英文替换成半角大写英文
        "Ｘ": "X",  # 将全角大写英文替换成半角大写英文
        "Ｙ": "Y",  # 将全角大写英文替换成半角大写英文
        "Ｚ": "Z",  # 将全角大写英文替换成半角大写英文
        "ａ": "a",  # 将全角小写英文替换成半角小写英文
        "ｂ": "b",  # 将全角小写英文替换成半角小写英文
        "ｃ": "c",  # 将全角小写英文替换成半角小写英文
        "ｄ": "d",  # 将全角小写英文替换成半角小写英文
        "ｅ": "e",  # 将全角小写英文替换成半角小写英文
        "ｆ": "f",  # 将全角小写英文替换成半角小写英文
        "ｇ": "g",  # 将全角小写英文替换成半角小写英文
        "ｈ": "h",  # 将全角小写英文替换成半角小写英文
        "ｉ": "i",  # 将全角小写英文替换成半角小写英文
        "ｊ": "j",  # 将全角小写英文替换成半角小写英文
        "ｋ": "k",  # 将全角小写英文替换成半角小写英文
        "ｌ": "l",  # 将全角小写英文替换成半角小写英文
        "ｍ": "m",  # 将全角小写英文替换成半角小写英文
        "ｎ": "n",  # 将全角小写英文替换成半角小写英文
        "ｏ": "o",  # 将全角小写英文替换成半角小写英文
        "ｐ": "p",  # 将全角小写英文替换成半角小写英文
        "ｑ": "q",  # 将全角小写英文替换成半角小写英文
        "ｒ": "r",  # 将全角小写英文替换成半角小写英文
        "ｓ": "s",  # 将全角小写英文替换成半角小写英文
        "ｔ": "t",  # 将全角小写英文替换成半角小写英文
        "ｕ": "u",  # 将全角小写英文替换成半角小写英文
        "ｖ": "v",  # 将全角小写英文替换成半角小写英文
        "ｗ": "w",  # 将全角小写英文替换成半角小写英文
        "ｘ": "x",  # 将全角小写英文替换成半角小写英文
        "ｙ": "y",  # 将全角小写英文替换成半角小写英文
        "ｚ": "z",  # 将全角小写英文替换成半角小写英文
        "１": "1",  # 将全角数字替换成半角数字
        "２": "2",  # 将全角数字替换成半角数字
        "３": "3",  # 将全角数字替换成半角数字
        "４": "4",  # 将全角数字替换成半角数字
        "５": "5",  # 将全角数字替换成半角数字
        "６": "6",  # 将全角数字替换成半角数字
        "７": "7",  # 将全角数字替换成半角数字
        "８": "8",  # 将全角数字替换成半角数字
        "９": "9",  # 将全角数字替换成半角数字
        "０": "0",  # 将全角数字替换成半角数字
        "\t": " ",  # 将制表符替换为空格
    }
    CHINESE_REP_WORD = {
        "姊": "姐",  # 中文简体常见错字全局替换
        "著": "着",  # 中文简体常见错字全局替换
        "慾": "欲",  # 中文简体常见错字全局替换
        "肏": "操",  # 中文简体常见错字全局替换
        "裡": "里",  # 中文简体常见错字全局替换
        "係": "系",  # 中文简体常见错字全局替换
        "繫": "联",  # 中文简体常见错字全局替换
        "豔": "艳",  # 中文简体常见错字全局替换
        "妳": "你",  # 中文简体常见错字全局替换
        "歳": "岁",  # 中文简体常见错字全局替换
        "廿": "二十",  # 中文简体常见错字全局替换
        "卅": "三十",  # 中文简体常见错字全局替换
        "卌": "四十",  # 中文简体常见错字全局替换
    }
    TITLE_REP = [
        "第一集",
        "第二集",
        " - 上",
        " - 下",
        " 上集",
        " 下集",
        " -上",
        " -下",
        "Part.1 (HD)",
        "(蓝光碟版)",
        "(蓝光版)",
        "(ブルーレイ版)",
    ]
    SHOW_KEY = [
        "number",
        "letters",
        "has_sub",
        "cd_part",
        "mosaic",
        "title",
        "originaltitle",
        "actor",
        "outline",
        "originalplot",
        "tag",
        "release",
        "year",
        "runtime",
        "score",
        "wanted",
        "series",
        "director",
        "studio",
        "publisher",
        "trailer",
        "website",
        "javdbid",
    ]
    FULL_HALF_CHAR = [
        ("・", "·"),
        ("．", "."),
        ("，", ","),
        ("！", "!"),
        ("？", "?"),
        ("”", '"'),
        ("’", "'"),
        ("‘", "`"),
        ("＠", "@"),
        ("＿", "_"),
        ("：", ":"),
        ("；", ";"),
        ("＃", "#"),
        ("＄", "$"),
        ("％", "%"),
        ("＆", "&"),
        ("（", "("),
        ("）", ")"),
        ("‐", "-"),
        ("＝", "="),
        ("＊", "*"),
        ("＋", "+"),
        ("－", "-"),
        ("／", "/"),
        ("＜", "<"),
        ("＞", ">"),
        ("［", "["),
        ("￥", "\\"),
        ("］", "]"),
        ("＾", "^"),
        ("｛", "{"),
        ("｜", "|"),
        ("｝", "}"),
        ("～", "~"),
        ("ａ", "a"),
        ("ｂ", "b"),
        ("ｃ", "c"),
        ("ｄ", "d"),
        ("ｅ", "e"),
        ("ｆ", "f"),
        ("ｇ", "g"),
        ("ｈ", "h"),
        ("ｉ", "i"),
        ("ｊ", "j"),
        ("ｋ", "k"),
        ("ｌ", "l"),
        ("ｍ", "m"),
        ("ｎ", "n"),
        ("ｏ", "o"),
        ("ｐ", "p"),
        ("ｑ", "q"),
        ("ｒ", "r"),
        ("ｓ", "s"),
        ("ｔ", "t"),
        ("ｕ", "u"),
        ("ｖ", "v"),
        ("ｗ", "w"),
        ("ｘ", "x"),
        ("ｙ", "y"),
        ("ｚ", "z"),
        ("Ａ", "A"),
        ("Ｂ", "B"),
        ("Ｃ", "C"),
        ("Ｄ", "D"),
        ("Ｅ", "E"),
        ("Ｆ", "F"),
        ("Ｇ", "G"),
        ("Ｈ", "H"),
        ("Ｉ", "I"),
        ("Ｊ", "J"),
        ("Ｋ", "K"),
        ("Ｌ", "L"),
        ("Ｍ", "M"),
        ("Ｎ", "N"),
        ("Ｏ", "O"),
        ("Ｐ", "P"),
        ("Ｑ", "Q"),
        ("Ｒ", "R"),
        ("Ｓ", "S"),
        ("Ｔ", "T"),
        ("Ｕ", "U"),
        ("Ｖ", "V"),
        ("Ｗ", "W"),
        ("Ｘ", "X"),
        ("Ｙ", "Y"),
        ("Ｚ", "Z"),
        ("０", "0"),
        ("１", "1"),
        ("２", "2"),
        ("３", "3"),
        ("４", "4"),
        ("５", "5"),
        ("６", "6"),
        ("７", "7"),
        ("８", "8"),
        ("９", "9"),
        ("　", " "),
    ]
    SPECIAL_WORD = {
        "強●": "強制",
        "犯●": "犯さ",
        "凌●": "凌辱",
        "折●": "折檻",
        "奴●": "奴隷",
        "輪●": "輪姦",
        "痴●": "痴漢",
        "近●": "近親",
        "小●生": "小学生",
        "中●生": "中学生",
        "女子●生": "女子校生",
        "強○": "強制",
        "犯○": "犯さ",
        "凌○": "凌辱",
        "折○": "折檻",
        "奴○": "奴隷",
        "輪○": "輪姦",
        "痴○": "痴漢",
        "近○": "近親",
        "小○生": "小学生",
        "中○生": "中学生",
        "女子○生": "女子校生",
        "ﾒｲﾄﾞ": "メイド",
        "ﾎｰﾙﾄﾞ": "ホールド",
    }
    ACTRESS_WIKI_KEYWORDS = [
        "AV idol",
        "pornographic",
        "pornoactrice",
        "Japanese idol",
        "Japanese actress",
        "AV actress",
        "porn star",
        "gravure",
        "director",
        "voice actor",
        "gravure idol",
        "model",
        "Porn actresses",
    ]
